package com.hmdp.utils;

import com.hmdp.dto.UserDTO;
import com.hmdp.entity.User;

/**
 * @ClassName UserHolderMyl
 * @Description TODO
 * @Author kiku
 * @Date 2025/2/9 12:42
 * @Version 1.0
 */
public class UserHolderMyl {

    private static final ThreadLocal<User> tl = new ThreadLocal<>();

    public static void saveUser(User user) {
        tl.set(user);
    }

    public static User getUser() {
        return tl.get();
    }

    public static void removeUser() {
        tl.remove();
    }

}
